package com.anpy.bill.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 图片实体类
 */
@Data
@TableName(value = "T_PHOTO")
@ApiModel(description = "图片信息")
public class PhotoEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "图片ID", example = "1")
    private Long id;

    @TableField(value = "album_id")
    @ApiModelProperty(value = "相册ID", example = "1")
    private Integer albumId;

    @TableField(value = "photo_name")
    @ApiModelProperty(value = "图片名称", example = "家庭聚餐照片")
    private String photoName;

    @TableField(value = "photo_url")
    @ApiModelProperty(value = "图片URL", example = "https://qiniu.example.com/photo.jpg")
    private String photoUrl;

    @TableField(value = "create_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", example = "2025-02-27 15:00:00")
    private Date createAt;

    @TableField(value = "update_at")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", example = "2025-02-27 15:00:00")
    private Date updateAt;

    @TableField(value = "user_id")
    @ApiModelProperty(value = "用户ID", example = "1")
    private Integer userId;
}
